<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>操作失败</title>
</head>
<body>
<h1>操作失败</h1>
<p id="errorMsg"></p>
<a href="/dept/list">返回部门列表</a>

<script>
    // 获取URL中的参数
    function getQueryStringParameter(name) {
        let result = null;
        const items = location.search.substr(1).split("&");
        for (let i = 0; i < items.length; i++) {
            const tmp = items[i].split("=");
            if (tmp[0] === name) {
                result = decodeURIComponent(tmp[1]);
                break;
            }
        }
        return result;
    }

    // 显示错误信息
    document.getElementById('errorMsg').textContent = getQueryStringParameter('errorMsg');
</script>
</body>
</html>